package com.example.spinning.utils;

import java.util.List;

public class toStringUtil {
    /*
     * 把List集合转化成指定格式的String类型
     */
    public String ListToString(List<String> list){
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < list.size(); i++) {
            sb.append(list.get(i));
            sb.append(",");
        }
        sb.deleteCharAt(sb.length() - 1);
        return sb.toString();
    }
    /*
     * 判断字符串是否为数字
     */
    public static boolean isNumber(String str){
        for (int i = 0; i < str.length(); i++) {
            if(!Character.isDigit(str.charAt(i))){
                return false;
            }
        }
        return true;
    }

}

